<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <a href="#abc">调到锚点abc处</a><a href="#def">调到锚点def处</a>
    <div></div>
    <div></div>
    <div id="abc">ssasdjdjaklal</div>
    <p id="def">kdnklsanfnjsdnmda;ckzklndklasmdlksnakfl</p>
    <script>
      window.addEventListener('hashchange', function (e) {
        e.preventDefault()
        console.log(e)

        var newUrl = e.newURL
        var index = newUrl.indexOf('#')

        var hashVaue = newUrl.substring(index + 1)

        console.log(hashVaue)

        var reqUrl = 'localhost:8080/firstweb/' + hashVaue

        $.get(Request, function (result) {})
      })
    </script>
  </body>
</html>
